package algotithm.interview.didi.test2;

import java.io.*;

/**
 * @author zhouyanxiang
 * @Date 2021-03-2021/3/20-20:10
 */
public class Main {

    public static int[] p = new int[100010];
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));
        int t = Integer.parseInt(reader.readLine());
        int x = t;
        while (x-- > 0) {
            String[] s = reader.readLine().split(" ");
            int N = Integer.parseInt(s[0]);
            int M = Integer.parseInt(s[1]);
            for (int i = 1; i <= N; i++) {
                p[i] = i;
            }
            int y = M;
            int cnt = 0;
            while (y-- > 0) {
                String[] str = reader.readLine().split(" ");
                int a = Integer.parseInt(str[0]);
                int b = Integer.parseInt(str[1]);
            }
        }
        writer.write("Yes" +"\n");
        writer.write("No" +"\n");
        writer.flush();
        writer.close();
        reader.close();
    }

    public static int find(int x) {
        while(x != p[x]) {
            p[x] = p[p[x]];
            x = p[x];
        }
        return x;
    }

}
